package Design_patterns.creator_mode.prototype.demo2;

/**
 * @description: 原型模式测试类
 **/

public class CitationTest {
    public static void main(String[] args) throws CloneNotSupportedException {
        //创建原型对象
        Citation citation = new Citation();
        citation.setName("张三");
        //克隆对象
        Citation clone = citation.clone();

        clone.setName("李四");

        citation.show();
        clone.show();
    }
}
